<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text"
                   value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text"
                   value="{$row.mobile|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text"
                       value="{$row.image}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload"
                                  data-input-id="c-image"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose"
                                  data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i
                            class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" data-rule="" class="form-control" size="50" name="row[images]" type="text"
                       value="{$row.images}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload"
                                  data-input-id="c-images"
                                  data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp"
                                  data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose"
                                  data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i
                            class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Starttime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-starttime" data-rule="required" class="form-control datetimepicker" data-date-format=" HH:mm"
                   name="row[starttime]" type="text" value="{:$row.starttime?datetime($row.starttime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Endtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-endtime" data-rule="required" class="form-control datetimepicker" data-date-format=" HH:mm"
                   name="row[endtime]" type="text" value="{:$row.endtime?datetime($row.endtime):''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Select map location')}:</label>
        <div class="col-xl-12 col-sm-8">
            <button type="button" class="btn btn-primary" data-toggle='addresspicker' data-input-id="c-address_map"
                    data-lng-id="c-lng" data-lat-id="c-lat">点击选择地址获取经纬度
            </button>
            <span class="help-block">提示：若点击无反应需下载插件《地图位置(经纬度)选择插件》</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Address map')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address_map" data-rule="required" class="form-control" name="row[address_map]" type="text"
                   value="{$row.address_map|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
        <div class="col-xs-12 col-sm-3">
            <input id="c-lng" data-rule="required" class="form-control" name="row[lng]" type="number" max="99999999"
                   value="{$row.lng|htmlentities}">
        </div>
        <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
        <div class="col-xs-12 col-sm-3">
            <input id="c-lat" data-rule="required" class="form-control" name="row[lat]" type="number" max="99999999"
                   value="{$row.lat|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text"
                   value="{$row.address|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Distance')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-distance" data-rule="required" class="form-control" name="row[distance]" type="number" max="99999999"
                   value="{$row.distance}" min="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Min price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_price" data-rule="required" class="form-control" name="row[min_price]" type="number" max="99999999"
                   value="{$row.min_price}" min="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Delivery price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-delivery_price" data-rule="required" class="form-control" name="row[delivery_price]" max="99999999"
                   type="number" value="{$row.delivery_price}" min="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Notice')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-notice" value="{$row.notice}" data-rule="" class="form-control" name="row[notice]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label for="c-admin_id" class="control-label col-xs-12 col-sm-2">{:__('绑定管理员')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if $auth->isSuperAdmin() }
            <input id="c-admin_id" data-rule="required" data-multiple="true" data-field="nickname"
                   data-source="auth/admin/index" class="form-control selectpage" name="row[admin_id]" type="text"
                   value="{:isset($row['admin_id'])?$row['admin_id']:''}">
            {else/}
            <input id="c-admin_id" data-rule="required" data-multiple="true" data-field="nickname"
                   data-source="auth/admin/index" class="form-control selectpage" type="text"
                   value="{:isset($row['admin_id'])?$row['admin_id']:''}"
                   disabled placeholder="超级管理员才能编辑">
            {/if}
            <span class="help-block">绑定的系统管理员可操作：非超管功能集，接收新订单通知（需安装插件《实时语音后台通知消息》）</span>
        </div>
    </div>
    <div class="form-group">
        <label for="c-admin_id" class="control-label col-xs-12 col-sm-2">{:__('绑定打印机')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-uniprint_id" data-rule="" data-field="name" data-multiple="true"
                   data-source="unidrink/printers/index" class="form-control selectpage" name="row[uniprint_id]"
                   type="text" value="{:isset($row['uniprint_id'])?$row['uniprint_id']:''}">
            <span class="help-block">绑定店铺所使用的打印机</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['1'=>__('Yes'), '0'=>__('No')], $row.status)}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
